/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_navigation_button.css made available under Mozilla Public License v. 2.0
See the above repository for updates as well as full license text. */

/* Hides navigation-buttons (back/forward/stop/reload) buttons and shows them when cursor is over the right edge of urlbar  */
/* Disabled button are completely hidden, such as back-button when there is no page to go back to */

/* To set this up you need to customize the order of items to be such that layout from LEFT to RIGHT is 
urlbar
flexible space
navigation-buttons in any order
 */
/* The order of items before urlbar and after navigation-buttons doesn't matter */

:is(#back-button,#forward-button),
#reload-button{
  margin-inline-start: -34px !important;
  visibility:hidden;
  transition: margin 66ms linear !important
}

:is(#back-button,#forward-button):hover,
:is(#back-button,#forward-button):hover ~ :is(#back-button,#stop-reload-button,#forward-button),
:is(#back-button,#forward-button):hover ~ #stop-reload-button > #reload-button,
#urlbar-container + toolbarspring:hover ~ :is(#back-button,#forward-button),
#stop-reload-button:hover > #reload-button,
#urlbar-container + toolbarspring:hover ~ #stop-reload-button > #reload-button{
  margin-inline-start: 0px !important;
  visibility: visible
}

#nav-bar-customization-target > #downloads-button { margin-inline-start: 0px !important; visibility: visible !important; }

:is(#back-button,#forward-button)[disabled],
#stop-reload-button > [disabled]{ display: none }

#urlbar-container + toolbarspring{ max-width: 4px !important; min-width: 4px !important; }